// +---------------------------------------------------------------------------------
// | FanAdmin 致力于为快速构建管理应用程序提供解决方案
// +---------------------------------------------------------------------------------
// | 简单轻量, 高颜值, 高效率, 让后台开发更简单
// | 代码的简洁规范, 通俗易懂, 无过度封装, 对萌新小白十分友好
// | 代码注释完整易读性高, 尽量保障初级程序员也可读懂, 极大提升二开效率
// | 同样是一个快速学习前沿技术的最佳实践, 永久免费开源使用
// +---------------------------------------------------------------------------------
// | Author: xiejiafan <82864861@qq.com>
// +---------------------------------------------------------------------------------
// | Thank you very much for using FanAdmin. https://gitee.com/xiejiafan/fanadmin
// +---------------------------------------------------------------------------------

import SvgIcon from './SvgIcon/Index.vue'
import Dialog from './Dialog/Index.vue'
import Toolbar from './Toolbar/Index.vue'
import Tag from './Tag/Index.vue'
import Icon from './Icon/Index.vue'
import Drawer from './Drawer/Index.vue'
import Image from './Image/Index.vue'
import UploadFile from './Upload/File.vue'
import UploadImage from './Upload/Image.vue'
import UploadImages from './Upload/Images.vue'
import MobileDrawer from './MobileDrawer/Index.vue'
import TagFilter from './TagFilter/Index.vue'
import Excel from './Excel/Index.vue'

import type { App, Component } from 'vue'
// 对外暴露插件对象，注册全局组件
const components: { [name: string]: Component } = {
  SvgIcon,
  Dialog,
  Toolbar,
  Tag,
  Icon,
  Drawer,
  Image,
  UploadFile,
  UploadImage,
  UploadImages,
  MobileDrawer,
  TagFilter,
  Excel,
}
export default {
  // install方法， Object.keys()得到对象所有的key
  install(app: App) {
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key])
    })
  },
}
